package com.leo.neo4j;

import com.leo.neo4j.entity.CompanyGraph;
import com.leo.neo4j.entity.CompanyGraphRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("neo4j")
public class Neo4jController {
    @Autowired
    private CompanyGraphRepository companyGraphRepository;
    @GetMapping
    public CompanyGraph test(){
        CompanyGraph graph = new CompanyGraph();
        graph.setName("123");
        companyGraphRepository.save(graph);
        System.out.println("neo4j success");
        return graph;
    }
}
